package chapter07;

import java.util.Arrays;
import java.util.Comparator;

public class Test07_arrays {
    public static void main(String[] args) {
        int[] a = {1,2,4,51,2,1,4,5};
        Arrays.sort(a);
        String[] b = {"1","11","12","5"};
        Arrays.sort(b, new Comparator<String>() {
            @Override
            public int compare(String o1, String o2) {
                return Integer.compare(Integer.parseInt(o1),Integer.parseInt(o2));
            }
        });
        System.out.println(Arrays.toString(a));
        System.out.println(Arrays.toString(b));
    }
}
